//
//  BookInfoCCell.m
//  EbookOnline
//
//  Created by mac on 15/4/15.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "BookInfoCCell.h"

@implementation BookInfoCCell


- (UILabel *)name{
    if (_name==nil) {
        _name = [[UILabel alloc]init];
        _name.textColor = [UIColor colorWithWhite:.3 alpha:1];
        _name.font = [UIFont systemFontOfSize:12];
        _name.numberOfLines=2;
        [self.contentView addSubview:_name];
        [_name mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(0);
            make.height.mas_greaterThanOrEqualTo(30);
            make.width.mas_lessThanOrEqualTo(self.contentView.mas_width).offset(-10);
            make.centerX.mas_equalTo(self.contentView.mas_centerX).offset(0);
        }];
    }
    return _name;
}

- (UIImageView *)coverImageView{
    if (_coverImageView==nil) {
        _coverImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_coverImageView];
        
        [_coverImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.contentView.mas_top).offset(5);
            make.bottom.mas_equalTo(self.name.mas_top).offset(0);
            make.width.mas_equalTo(_coverImageView.mas_height).dividedBy(82/65.f);
            make.centerX.mas_equalTo(self.contentView.mas_centerX).offset(0);
        }];
    }
    return _coverImageView;
}

@end
